<template>
	<view class="notice-info">
		<view class="user">
			<u-avatar v-if="info.avatar" :src="info.avatar" :size="84"></u-avatar>
			<u-avatar v-else src="../../../static/user/avatar.png"></u-avatar>
			<view>
				<text class="infoName">{{ info.username }}</text>
				<text class="infoTime">{{ info.createtime }}</text>
			</view>
		</view>
		<view class="container">
			<view class="title">{{ info.name }}</view>
			<text class="content">{{ info.content }}</text>
		</view>
		<u-button class="button" v-if="info.paperid" @click="handleClick" shape="circle" :ripple="true">参加考试</u-button>
	</view>
</template>

<script>
import exam from '../../../mixins/exam.js';
export default {
	mixins: [exam],
	onLoad({ title, info }) {
		setTimeout(() => {
			uni.setNavigationBarTitle({
				title
			});
		},100)
		this.info = JSON.parse(info);
	},
	data() {
		return { info: null };
	},
	methods: {
		handleClick() {
			uni.switchTab({
				url:"../../exam/exam"
			})
			// this.startExam(this.info, 'redirectTo');
		}
	}
};
</script>

<style>
page {
	background-color: #ffffff;
}
</style>
<style lang="scss" scoped>
.notice-info {
	padding: 60upx 30upx 0 30upx;
	.user {
		display: flex;
		view:last-child {
			display: flex;
			flex-direction: column;
			justify-content: space-evenly;
			margin-left: 26upx;
		}
	}
	.title {
		font-size: 32upx;
		font-weight: 500;
		color: #363940;
		margin: 60upx 0;
	}
	.content {
		font-size: 32upx;
		font-weight: 400;
		color: #363940;
		line-height: 1.5;
	}
}
.infoName{
	color: #363940;
	font-size: 30upx;
}
.infoTime{
	color: #A6A6A6;
	font-size: 26upx;
}
.button {
	width: 350upx;
	height: 76upx;
	position: absolute !important;
	bottom: 200upx;
	left: 0;
	right: 0;
	font-size: 32upx;
	background:$linear-bg;
	color: #ffffff !important;
}
.button::after {
	border: none !important;
}
</style>
